home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / IDLIncludes / HIWindows.idl < prev    next >
Text File  |  1996-05-01  |  14KB  |  484 lines

  1. /*
  2.      File:        HIWindows.idl
  3.  
  4.      Contains:    Standard window class.
  5.  
  6.      Version:    Technology:    System 8.0
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1995-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16. */
  17.  
  18.  
  19. #ifndef __HIWINDOWS_IDL__
  20. #define __HIWINDOWS_IDL__
  21.  
  22. #include <Types.idl>
  23. #include <Windows.idl>
  24. #include <HIObjects.idl>
  25. #include <HIEmbeddingPanels.idl>
  26. #include <HIWindowTypes.idl>
  27.  
  28.  
  29.  
  30. interface HIWindow : HIObject
  31. {
  32. // ======================================================
  33. // Public Methods
  34. // ======================================================
  35.  
  36. // * Initializers *
  37.  
  38.     OSStatus InitWindow(in RefLabel                identifier,
  39.                         in Rect                    globalBounds,
  40.                         in HIWindowClass        windowClass,
  41.                         in HIWindowVariant        windowVariant,
  42.                         in HIWindowAttributes    windowAttributes, 
  43.                         in HIRootPanel            rootPanel,
  44.                         in HIWindow             behindThisWindow);
  45.  
  46.     OSStatus InitWindowInLayer(    in RefLabel                identifier,
  47.                                 in Rect                    globalBounds,
  48.                                 in HIWindowClass        windowClass,
  49.                                 in HIWindowVariant        windowVariant,
  50.                                 in HIWindowAttributes    windowAttributes, 
  51.                                 in HIRootPanel            rootPanel,
  52.                                 in HIWindow             behindThisWindow,
  53.                                 in HILayerRef            containingLayer);
  54.                             
  55. // * Window state *
  56.  
  57.     OSStatus Select();
  58.     OSStatus SelectWithGroup(in HIWindowGroupRef groupRef);
  59.     
  60.     OSStatus Hilite();
  61.     OSStatus Unhilite();
  62.     boolean IsHilited();
  63.     
  64.     boolean    IsActive();
  65.     
  66.     OSStatus BringToFront();
  67.     OSStatus SendBehind(in HIWindow behindThisWindow);
  68.     
  69.     OSStatus ShowWithoutActivate();
  70.     OSStatus HideWithoutActivate();
  71.     
  72.     OSStatus Zoom(    in HIWindowPartCode    whichPart,
  73.                     in boolean             front);
  74.     OSStatus ZoomOut(in Point idealSize);
  75.  
  76.     OSStatus Collapse();
  77.     OSStatus Expand();
  78.     boolean IsCollapsed();
  79.  
  80. // * Window groups *
  81.  
  82.     OSStatus SetAttachedWindowGroup(in HIWindowGroupRef    groupRef);
  83.     HIWindowGroupRef GetAttachedWindowGroup();
  84.     
  85.     OSStatus AddToGroup(in HIWindowGroupRef groupRef);
  86.     OSStatus RemoveFromGroup(in HIWindowGroupRef groupRef);
  87.  
  88. // * Invalidation *
  89.  
  90.     OSStatus InvalidateRect(in Rect badRect);
  91.     OSStatus InvalidateRgn(in RgnHandle badRgn);
  92.     OSStatus ValidateRect(in Rect goodRect);
  93.     OSStatus ValidateRgn(in RgnHandle goodRgn);
  94.  
  95. // * Drawing content *
  96.  
  97.     OSStatus SetPort();
  98.  
  99.     OSStatus BeginUpdate();
  100.     OSStatus EndUpdate();
  101.     
  102.     OSStatus DrawGrowIcon();
  103.     
  104. // * Positioning & sizing
  105.  
  106.     OSStatus PositionOnScreen(    in Rect                         globalReferenceRect,
  107.                                   in boolean                        findScreen,
  108.                                 in HIWindowHorizontalConstraint    horizontalConstraint,
  109.                                 in HIWindowVerticalConstraint     verticalConstraint);
  110.         
  111.     OSStatus AutoPosition(    in HIWindowLocationConstraint        locationConstraint,
  112.                             in HIWindowHorizontalConstraint     horizontalConstraint,
  113.                             in HIWindowVerticalConstraint         verticalConstraint);                                
  114.  
  115.     boolean IsPositionedOnScreen(    in HIWindowPartCode whichPart, 
  116.                                     in boolean             entirelyOnScreen);
  117.                 
  118. // * General accessors *
  119.  
  120.     OSStatus SetAttributes(    in HIWindowAttributes    newAttributes,
  121.                             in boolean                redraw);
  122.     HIWindowAttributes GetAttributes();
  123.     
  124.     OSStatus SetClass(in HIWindowClass newClass);
  125.     HIWindowClass GetClass();
  126.     
  127.     OSStatus SetVariant(in HIWindowVariant newVariant);
  128.     HIWindowVariant GetVariant();
  129.     
  130.     OSStatus GetStructureRgn(in RgnHandle structureCopy);
  131.     OSStatus GetContentRgn(in RgnHandle contentCopy);
  132.     OSStatus GetUpdateRgn(in RgnHandle updateCopy);
  133.  
  134.     OSStatus SetStandardState(in Rect globalStandardState);
  135.     Rect* GetStandardState(out Rect globalStandardState);
  136.  
  137.     OSStatus SetUserState(in Rect globalUserState);
  138.     Rect* GetUserState(out Rect globalUserState);
  139.     
  140.     OSStatus SetDefaultGrowLimits(in Point minimumSize, in Point maximumSize);
  141.     OSStatus GetDefaultGrowLimits(out Point minimumSize, out Point maximumSize);
  142.  
  143.     OSStatus SetDefaultOptimalSize(in Point defaultSize);
  144.     OSStatus GetDefaultOptimalSize(out Point defaultSize);
  145.     
  146.     HIRootPanel GetRootPanel();
  147.     OSStatus SetRootPanel(in HIRootPanel thePanel);
  148.     
  149.     AEDispatcherRef GetEventDispatcher();
  150.  
  151. // * Events *
  152.  
  153.     OSStatus HandleMouseDown(    in Point                globalPt,
  154.                                 in EventModifiers        modifiers, 
  155.                                 in AppleEvent            theEvent,
  156.                                 in AppleEvent            reply,
  157.                                 in AEHandlerTableRef     handlerTableRef);
  158.     
  159.     OSStatus HandleMouseMoved(    in Point                globalPt,
  160.                                 in EventModifiers        modifiers, 
  161.                                 in AppleEvent            theEvent,
  162.                                 in AppleEvent            reply,
  163.                                 in AEHandlerTableRef     handlerTableRef);
  164.  
  165.     OSStatus HandleMouseStoppedMoving(    in Point                globalPt,
  166.                                         in EventModifiers        modifiers, 
  167.                                         in AppleEvent            theEvent,
  168.                                         in AppleEvent            reply,
  169.                                         in AEHandlerTableRef     handlerTableRef);
  170.     
  171.     OSStatus HandleMouseUp(    in Point                globalPt,
  172.                             in EventModifiers        modifiers, 
  173.                             in AppleEvent            theEvent,
  174.                             in AppleEvent            reply,
  175.                             in AEHandlerTableRef     handlerTableRef);
  176.  
  177.     OSStatus HandleMouseDownInBack(    in Point                portLocalWhere,
  178.                                     in EventModifiers        modifiers, 
  179.                                     in AppleEvent            theEvent,
  180.                                     in AppleEvent            reply,
  181.                                     in AEHandlerTableRef     handlerTableRef);
  182.     
  183.     OSStatus HandleUpdate(    in AppleEvent            theEvent,
  184.                             in AppleEvent            reply,
  185.                             in AEHandlerTableRef    handlerTableRef);
  186.     
  187.     OSStatus HandleResize(    in Rect                    originalBounds,
  188.                             in Rect                    newBounds,
  189.                             in AppleEvent            theEvent,
  190.                             in AppleEvent            reply,
  191.                             in AEHandlerTableRef     handlerTableRef);
  192.                             
  193.     OSStatus HandleClose(    in boolean                closeAll,
  194.                             in AppleEvent            theEvent,
  195.                             in AppleEvent            reply,
  196.                             in AEHandlerTableRef     handlerTableRef);
  197.     
  198. // *†Frame support *
  199.  
  200.     void AdjustDragLimits(inout Rect dragLimits);
  201.     void AdjustGrowLimits(inout Point minimumSize, inout Point maximumSize);
  202.     
  203.     OSStatus TrackPart(    in Point             globalPt,
  204.                         in EventModifiers    modifiers,
  205.                         in HIWindowPartCode    whichPart);
  206.  
  207. // Protected frame support methods
  208. // Call these methods only from within object implementation!
  209.  
  210.     /*
  211.         These two calls should draw in drawPort. Drawing should be done in global coords.
  212.     */
  213.     
  214.     void DrawFrame(in CGrafPtr drawPort);
  215.     void DrawOutline(    in Rect        globalOutlineRect,
  216.                         in CGrafPtr    drawPort);    
  217.     
  218.     /*
  219.         If the window's resize box(es) are in the window's content region, they should be drawn
  220.         by this method, in the local coordinate system of the window. If they are in the window's
  221.         structure, they should be drawn by DrawFrame.
  222.     */
  223.     void DrawSizeBox(in CGrafPtr drawPort);
  224.     
  225.     
  226.     /*
  227.          The Window Manager will repeatedly call virtual HitTest and HilitePart to determine
  228.         where in the window the cursor is and to give visual feedback.
  229.     */
  230.     
  231.     void HilitePart(in HIWindowPartCode    whichPart,
  232.                     in boolean            hiliteFlag,
  233.                     in CGrafPtr            drawPort); 
  234.     HIWindowPartCode HitTest(in Point globalHitPt);
  235.     
  236.     OSStatus GetPartRgn(in HIWindowRgnCode    windowRgn,
  237.                         in RgnHandle        theRgn);
  238.     
  239.     /*
  240.          Override GetUnusedGadgetRects() so that during drawing you remove any gadget rect space
  241.         occupied by a custom gadget in the title bar that you might draw. This prevents multiple
  242.         clients from drawing custom gadgets on top of eachother.
  243.     */
  244.     
  245.     OSStatus GetUnusedGadgetRects(    out Rect    leftRect,
  246.                                     out Rect    rightRect);
  247.     
  248.     /*
  249.         The Window Manager will call GetGrowDirection to determine the direction(s) in which the
  250.         window is being resized. It will then call DrawOutline in XOR mode to repeatedly draw and
  251.         erase the window outline as it is resized.
  252.     */
  253.     
  254.     HIWindowGrowDirection GetGrowDirection(in Point globalHitPt);
  255.     
  256.  
  257. // ===========================================================
  258. // Procedural Calls
  259. //     These are not object methods, but rather static functions
  260. // ===========================================================
  261.  
  262.     HILayerRef GetPrimaryLayer();
  263.     
  264. // * Window groups *
  265.  
  266.     OSStatus NewWindowGroup(out HIWindowGroupRef newGroup);
  267.     OSStatus DisposeWindowGroup(in HIWindowGroupRef    groupToDispose);
  268.     OSStatus AddWindowGroupToWindowGroup(    in HIWindowGroupRef    baseGroup,
  269.                                             in HIWindowGroupRef    groupToAdd);
  270.     OSStatus RemoveWindowGroupFromWindowGroup(    in HIWindowGroupRef    baseGroup,
  271.                                                 in HIWindowGroupRef    groupToRemove);
  272.  
  273.     HIWindowGroupRef GetApplicationWindowGroup();
  274.     HIWindowGroupRef GetWindowClassWindowGroup(in HIWindowClass windowClass);
  275.     
  276.     OSStatus GetWindowsInWindowGroup(    in HIWindowGroupRef    group,
  277.                                         in ItemCount         requestedWindows, 
  278.                                         out ItemCount         totalWindows,
  279.                                         inout HIWindow        windows);
  280.  
  281.     OSStatus GetWindowsInWindowGroupAndLayer(    in HIWindowGroupRef    group,
  282.                                                 in HILayerRef        layer,
  283.                                                 in ItemCount         requestedWindows, 
  284.                                                 out ItemCount         totalWindows,
  285.                                                 inout HIWindow        windows);
  286.  
  287.     OSStatus GetWindowGroupsInWindowGroup(    in HIWindowGroupRef        group,
  288.                                             in ItemCount             requestedGroups, 
  289.                                             out ItemCount             totalGroups,
  290.                                             inout HIWindowGroupRef    groups);
  291.  
  292. // * Front window information *
  293.  
  294.     HIWindow    FrontWindowOfWindowGroup(in HIWindowGroupRef group);
  295.     HIWindow    FrontNonFloatingWindow();
  296.  
  297. // * Floating windows *
  298.  
  299.     void         ShowFloatingWindows();
  300.     void        HideFloatingWindows();
  301.     boolean        AreFloatersVisible();
  302.  
  303.     void         ActivateFloatingWindows();
  304.     void         DeactivateFloatingWindows();
  305.  
  306. // * Automatic palette activation *
  307.  
  308.     void         EnableAutomaticPaletteActivation();
  309.     void         DisableAutomaticPaletteActivation();
  310.     boolean        IsAutomaticPaletteActivationEnabled();
  311.  
  312. // * WindowPtr -> HIWindow conversion *
  313.  
  314. //     NOTE: THIS IS A DEPRECATED API THAT IS NOT CONSIDERED SYSTEM 8 SAVVY. IT IS PROVIDED SO SYSTEM 7
  315. //           CLIENTS CAN ADD SOME SYSTEM 8 WINDOW MANAGER FEATURES TO THEIR APPLICATIONS BY CALLING
  316. //           HIWINDOW METHODS. *** CLIENTS CALLING THIS API WILL NOT WORK ON GERSHWIN ***
  317.  
  318.     HIWindow    GetHIWindow(in WindowPtr targetWindow);
  319.  
  320.     
  321.     
  322. // ======================================================
  323. // Implementation
  324. // ======================================================
  325.  
  326.     implementation 
  327.     {
  328.         
  329.         passthru C_h        =     "#include <Types.h>"
  330.                                 "#include <Windows.h>"
  331.                                 "#include <HIWindowTypes.h>"
  332.                                 "#include <HIEmbeddingPanels.h>";
  333.  
  334.         passthru C_xh        =     "#include <Types.h>"
  335.                                 "#include <Windows.h>"
  336.                                 "#include <HIWindowTypes.h>"
  337.                                 "#include <HIEmbeddingPanels.xh>";
  338.  
  339.  
  340.         GetPrimaryLayer:                        procedure, noself;
  341.         NewWindowGroup:                            procedure, noself;
  342.         DisposeWindowGroup:                        procedure, noself;
  343.         AddWindowGroupToWindowGroup:            procedure, noself;
  344.         RemoveWindowGroupFromWindowGroup:        procedure, noself;
  345.         GetApplicationWindowGroup:                procedure, noself;
  346.         GetWindowClassWindowGroup:                procedure, noself;
  347.         GetWindowsInWindowGroup:                procedure, noself;
  348.         GetWindowsInWindowGroupAndLayer:        procedure, noself;
  349.         GetWindowGroupsInWindowGroup:            procedure, noself;
  350.         FrontWindowOfWindowGroup:                procedure, noself;
  351.         FrontNonFloatingWindow:                    procedure, noself;
  352.         ShowFloatingWindows:                    procedure, noself;
  353.         HideFloatingWindows:                    procedure, noself;
  354.         AreFloatersVisible:                        procedure, noself;
  355.         ActivateFloatingWindows:                procedure, noself;
  356.         DeactivateFloatingWindows:                procedure, noself;
  357.         EnableAutomaticPaletteActivation:        procedure, noself;
  358.         DisableAutomaticPaletteActivation:        procedure, noself;
  359.         IsAutomaticPaletteActivationEnabled:    procedure, noself;
  360.         GetHIWindow:                            procedure, noself;
  361.  
  362.  
  363.         releaseorder:    InitWindow,
  364.                         InitWindowInLayer,
  365.                         Select,
  366.                         SelectWithGroup,
  367.                         Hilite,
  368.                         Unhilite,
  369.                         BringToFront,
  370.                         SendBehind,
  371.                         ShowWithoutActivate,
  372.                         HideWithoutActivate,
  373.                         Zoom,
  374.                         ZoomOut,
  375.                         Collapse,
  376.                         Expand,
  377.                         SetAttachedWindowGroup,
  378.                         GetAttachedWindowGroup,
  379.                         AddToGroup,
  380.                         RemoveFromGroup,
  381.                         InvalidateRect,
  382.                         InvalidateRgn,
  383.                         ValidateRect,
  384.                         ValidateRgn,
  385.                         SetPort,
  386.                         BeginUpdate,
  387.                         EndUpdate,
  388.                         DrawGrowIcon,
  389.                         PositionOnScreen,
  390.                         AutoPosition,
  391.                         IsPositionedOnScreen,
  392.                         SetAttributes,
  393.                         GetAttributes,
  394.                         SetClass,
  395.                         GetClass,
  396.                         SetVariant,
  397.                         GetVariant,
  398.                         GetStructureRgn,
  399.                         GetContentRgn,
  400.                         GetUpdateRgn,
  401.                         SetStandardState,
  402.                         GetStandardState,
  403.                         SetUserState,
  404.                         GetUserState,
  405.                         GetRootPanel,
  406.                         SetRootPanel,
  407.                         GetEventDispatcher,
  408.                         IsHilited,
  409.                         IsActive,
  410.                         IsCollapsed,
  411.                         HandleMouseDown,
  412.                         HandleMouseMoved,
  413.                         HandleMouseStoppedMoving,
  414.                         HandleMouseUp,
  415.                         HandleMouseDownInBack,
  416.                         HandleResize,
  417.                         HandleClose,
  418.                         TrackPart,
  419.                         DrawFrame,
  420.                         DrawOutline,
  421.                         DrawSizeBox,
  422.                         HilitePart,
  423.                         HitTest,
  424.                         GetPartRgn,
  425.                         GetUnusedGadgetRects,
  426.                         GetGrowDirection,
  427.                         GetPrimaryLayer,
  428.                         NewWindowGroup,
  429.                         DisposeWindowGroup,
  430.                         AddWindowGroupToWindowGroup,
  431.                         RemoveWindowGroupFromWindowGroup,
  432.                         GetApplicationWindowGroup,
  433.                         GetWindowClassWindowGroup,
  434.                         GetWindowsInWindowGroup,
  435.                         GetWindowsInWindowGroupAndLayer,
  436.                         GetWindowGroupsInWindowGroup,
  437.                         FrontWindowOfWindowGroup,
  438.                         FrontNonFloatingWindow,
  439.                         ShowFloatingWindows,
  440.                         HideFloatingWindows,
  441.                         AreFloatersVisible,
  442.                         ActivateFloatingWindows,
  443.                         DeactivateFloatingWindows,
  444.                         EnableAutomaticPaletteActivation,
  445.                         DisableAutomaticPaletteActivation,
  446.                         IsAutomaticPaletteActivationEnabled,
  447.                         GetHIWindow,
  448.                         
  449.                         reserved0,
  450.                         reserved1,
  451.                         reserved2,
  452.                         reserved3,
  453.                         reserved4,
  454.                         reserved5,
  455.                         reserved6,
  456.                         reserved7,
  457.                         reserved8,
  458.                         reserved9,
  459.                         reserved10,
  460.                         reserved11,
  461.                         reserved12,
  462.                         reserved13,
  463.                         reserved14,
  464.                         reserved15,
  465.                         reserved16,
  466.                         reserved17,
  467.                         reserved18,
  468.                         reserved19,
  469.                         reserved20,
  470.                         reserved21,
  471.                         reserved22,
  472.                         
  473.                         HandleUpdate,
  474.                         SetDefaultGrowLimits,
  475.                         GetDefaultGrowLimits,
  476.                         SetDefaultOptimalSize,
  477.                         GetDefaultOptimalSize,
  478.                         AdjustDragLimits,
  479.                         AdjustGrowLimits;
  480.     };
  481. };
  482.  
  483. #endif
  484.